package 牛客周赛.牛客周赛Round88;

import java.util.Scanner;

/**
 * @Title: C
 * @Author 贾金博
 * @Package 牛客周赛.牛客周赛Round88
 * @Date 2025/4/7 上午11:11
 * @description: this is C
 */
public class C {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while(t -- > 0 ) {
            // 读入3个点
            zb1[] a = new zb1[10];
            for(int i = 1; i <= 3; i ++ ) {
                a[i] = new zb1();
                a[i].x = sc.nextDouble();
                a[i].y = sc.nextDouble();
            }

            if(check(a[1], a[2], a[3]) || check(a[1], a[3], a[2]) || check(a[2], a[3], a[1]) || check(a[2], a[1], a[3]) || check(a[3], a[1], a[2]) || check(a[3], a[2], a[1]) ) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }

    }

    // 这里检查的是平行的关系
    public static boolean check(zb1 a, zb1 b, zb1 c) {
        // 先去拿到中间点
        double tX = (a.x + b.x) / 2.0;
        double tY = (a.y + b.y) / 2.0;

        if(tX == c.x || tY == c.y) {
            return true;
        }

        return false;
    }
}

class zb1 {
    double x, y;
}
